<script>
	import {mapState, mapMutations} from 'vuex'
	export default {
		onLaunch: function() {
			let role = uni.getStorageSync('baseId')
			if(role){
				this.setRole(role)
			}
			console.log('App Launch')
		},
		onShow: function() {
			console.log('App Show')
			var account=uni.getStorageSync('account')
			if(!account){
				uni.reLaunch({
					url:"/pages/login/login"
				})
			}
		},
		onHide: function() {
			console.log('App Hide')
		},
		methods: {
			...mapMutations(['setRole'])
		}
	}
</script>

<style lang="scss">
	/* 注意要写在第一行，同时给style标签加入lang="scss"属性 */
		@import "@/uni_modules/uview-ui/index.scss";
	/* 注意要写在第一行，同时给style标签加入lang="scss"属性 */
	// @import "uview-ui/index.scss";
</style>
